<?php 

trait A 
{
    public $name = 'anna';
    private $age = 18;
    protected $sex = '女';
}

class User
{
    use A;
}

$u = new User();

var_dump($u);
echo $u->name;